package cn.flexui.flexuiserver.common.convert;


import cn.flexui.flexuiserver.domain.FlexChatResponse;
import cn.flexui.flexuiserver.domain.entity.ChatRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;

import java.util.List;

/**
 * @author wanmingyu
 * @create 2024/9/22 12:17
 */
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface FlexChatResponseConvert {



    List<FlexChatResponse> toFlexChatResponseList(List<ChatRecord> list);

    @Mapping(target = "content", source = "content")
    @Mapping(target = "role", source = "messageType")
    FlexChatResponse toFlexChatResponse(ChatRecord chatRecord);
}
